extends "../cTDZ_2_1/cTDZ_2_1.gd"
func _info():
	pass
func _connect():
	._connect()

func _extInit():
	._extInit()
	chaName = "骷髅国王"
	lv = 3
	attCoe.atkRan = 1
	attCoe.atk = 21 / 8.5 * 2 / 3
	attCoe.maxHp = 1050 / 112.5 / 3
	attCoe.def = 140 / 15.0 / 3
	attCoe.mgiDef = 140 / 16.6 / 3 
	addCdSkill("klgw",5)
	addCdSkill("klgw1",10)
	addSkillTxt("国王威严：为所有敌方附加2层<畏缩>[cd:5秒]")
	addSkillTxt("国王恩赐：为攻击范围内队友附加(生命上限*5% + 50%物防）点护盾[cd:10秒]")
func _castCdSkill(id):
	._castCdSkill(id)
	if id == "klgw":
		cst("国王威严","000000",position)
		var chas = getAllChas(1)
		for i in chas:
			i.addBuff(ctrl.b_weisuo.new(2))
			
	if id == "klgw1":
		cst("国王恩赐","000000",position)
		var chas = getAllChas(2)
		for i in chas:
			if i == self:continue
			if inrange(i.cell,cell,att.atkRan):
				i.changeShield(att.maxHp * 0.05 + att.def * 0.5)
		changeShield(150)

func inrange(a,b,c):
	var x = abs(a.x - b.x)
	var y = abs(a.y - b.y)
	return x*x + y*y <= c*c